cssvalue: Change color transitions to run premultiplied
authorBenjamin Otte <otte@redhat.com>
Fri, 26 Jun 2015 19:08:04 +0000 (21:08 +0200)
committerBenjamin Otte <otte@redhat.com>
Fri, 26 Jun 2015 19:12:50 +0000 (21:12 +0200)
commitcd3f24d5793e038ee29d780b24747707c73ad00c
tree4e06de6da08db1f87e31219dcb4ea4e547cb1f35
parent142abce46a18ef09ca77ed581cf3b385671c9515
cssvalue: Change color transitions to run premultiplied

Previously, the unpremultiplied values from the GdkRGBA were taken. Now
we premultiply the color values as specified by the CSS specs.
This is only relevant when transitioning with translucent colors.

An example is the halfway transition between transparent (0, 0, 0, 0)
and white (1, 1, 1, 1). Previously, all 4 values where transitioned
separately and the result was semi-transparent gray (0.5, 0.5, 0.5,
0.5).
By depending on the alpha value, the result is now semi-transparent
white (1, 1, 1, 0.5) which is what one would naively expect.

New reftest: color-transition
gtk/gtkcssrgbavalue.c
testsuite/reftests/Makefile.am
testsuite/reftests/color-transition.css [new file with mode: 0644]
testsuite/reftests/color-transition.ref.ui [new file with mode: 0644]
testsuite/reftests/color-transition.ui [new file with mode: 0644]